﻿using System.Web.Mvc;

namespace FloodFree.Web.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            

            context.MapRoute(
                "Admin",
                "Admin/",
                new { controller = "Admin", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Cities",
                "Admin/Cities",
                new { controller = "Cities", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_States",
                "Admin/States",
                new { controller = "States", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Sensors",
                "Admin/Sensors",
                new { controller = "Sensors", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Sensors_Create",
                "Admin/Sensors/Create",
                new { controller = "Sensors", action = "Create", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Sensor_Show",
                "Admin/Sensors/{id}",
                new { controller = "Sensors", action = "Show", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Cities_New",
                "Admin/Cities/Create",
                new { controller = "Cities", action = "Create", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Cities_Edit",
                "Admin/Cities/{id}/Edit",
                new { controller = "Cities", action = "Edit", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Cities_Show",
                "Admin/Cities/{id}",
                new { controller = "Cities", action = "Show", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { controller="Admin", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
